package org.wuhong.controller;

import com.wuhong.entity.Catalogue;
import com.wuhong.result.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.wuhong.service.CatalogueService;

import java.util.Map;

/**
 * @ClassName CatalogueController
 * @Description TODO
 * @Author director吴
 * @Date 2023/1/2 17:16
 * @Version 1.0
 **/
@RequestMapping("/catalogue")
@ResponseBody
@Controller
public class CatalogueController {

    @Autowired
    CatalogueService catalogueService;

    @RequestMapping("/selectListFloder")
    public ResultData<Catalogue> selectListFloder(@RequestBody Map<String,Object> map) throws Exception {
        return catalogueService.getCatalogueByUserId((String) map.get("userId"));
    }

    @RequestMapping("/selectListFloder1")
    public ResultData<Catalogue> selectListFloder1(@RequestParam Map<String,Object> map) throws Exception {
        System.out.println("aaa");
        return catalogueService.getCatalogueByUserId((String) map.get("userId"));
    }
}
